Skip to main content
Glama
read.ts996 B
import { resolveFromUserData } from "@/helpers/paths"; import { extractMcpName } from "@/http/server/utils"; export const readConfiguration = async (pathname: string) => { const mcpNameResult = extractMcpName(pathname, "config"); // Handle potential Response error from mcpName extraction if (mcpNameResult instanceof Response) { return mcpNameResult; } // If we got here, mcpNameResult is a string const mcpName = mcpNameResult; const configurationPath = await resolveFromUserData("configuration.json"); let configuration = await Bun.file(configurationPath).json(); // Get the specific MCP configuration const mcpConfig = configuration.installed[mcpName]; if (!mcpConfig) { return new Response( JSON.stringify({ success: false, error: "MCP not found" }) ); } // Remove env from the specific MCP configuration delete mcpConfig.env; // res.json(configuration); return new Response(JSON.stringify({ success: true, data: mcpConfig })); };

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ashwwwin/furi'

If you have feedback or need assistance with the MCP directory API, please join our Discord server